import { QuestionItem } from '@/utils/interface'
import {request} from 'umi'
// 获取问题列表
export let getQuestionList = (type:string,quality:string,authentication:string,questionTitle:string,pageNum:number)=>{
    return request('/sypt/answer/list',{
        params:{
            isAsc: 'desc',
            pageNum,
            pageSize: 8,
            type ,
            questionTitle,
            quality,
            authentication,
            searchVal: '' 
        }
    })
}
// 获取项目下拉列表
export let getProList = ()=>{
    return request('/sypt/project/name/list')
}
// 获取任务下拉列表
export let getTask = (value:string)=>{
    return request(`/sypt/task/name/list/${value}`,{
        params:{
            0:value
        }
    })
}
// 添加问题
export let addQuestion = (type:string,text1:string,text2:string,questionTitle:string,questionContent:string,labels:string[])=>{
    return request('/sypt/answer',{
        method:'post',
        data:{
            type,
            text1,
            text2,
            questionTitle,
            questionContent,
            labels
        }
    })
}